package com.higgins.eventtracking.server.dataModel;

import java.util.Date;

import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

import com.google.appengine.api.datastore.Key;
import com.higgins.eventtracking.client.dto.HealthEventDTO;
import com.higgins.eventtracking.client.dto.WeightEventDTO;

@PersistenceCapable
public class WeightEvent {
	@SuppressWarnings("unused")
	@PrimaryKey
	@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
	private Long id;
	
	@Persistent
	private Date timestamp;
	
	@Persistent
	private String weightEventType;
	
	@Persistent
	private Double weightEventScale;

	public WeightEvent(WeightEventDTO dto)	{
		this.timestamp = dto.getTimestamp();
		this.weightEventType = dto.getWeightEventType();
		this.weightEventScale = dto.getWeightEventScale();
	}
	public WeightEvent()	{
		
	}

	public void setTimestamp(Date timestamp)	{
		this.timestamp = timestamp;
	}
	public Date getTimestamp()	{
		return timestamp;
	}
	public void setWeightEventType(String weightEventType)	{
		this.weightEventType = weightEventType;
	}
	public String getWeightEventType()	{
		return weightEventType;
	}
	public void setWeightEventScale(Double weightEventScale)	{
		this.weightEventScale = weightEventScale;
	}
	public Double getWeightEventScale()	{
		return weightEventScale;
	}
	public WeightEventDTO toDTO() {
		WeightEventDTO dto = new WeightEventDTO(timestamp, weightEventType, weightEventScale);		
		return dto;
	}

}
